package com.text.service;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class BookSelect {
	public static Connection con;
	public static PreparedStatement state;
	public static Connection con2;
	public static PreparedStatement state2;
	public static ResultSet set;
	public static ResultSet set2;

	public ResultSet SelectUser() throws ClassNotFoundException,
			SQLException {
		Class.forName("org.sqlite.JDBC");
		con = DriverManager.getConnection("jdbc:sqlite:frie/text.db");
		state = null;
		state = con.prepareStatement("select* from book");
		set = state.executeQuery();
		if (set.next()) {
			return set;
		}  else {
			set.close();
			state.close();
			con.close();
			return null;
		}

	}
}
